home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvi2tty / DVI.format < prev    next >
Text File  |  1995-01-12  |  3KB  |  71 lines

  1. /*
  2.  
  3.  
  4. ================================================================================
  5. ==                          DVI file format                                   ==
  6. ================================================================================
  7. no_ops          >= 0 bytes     (NOP, nops before the preamble)
  8. preamble_marker    1 ubyte     (PRE)
  9. version_id         1 ubyte     (should be version 2)
  10. numerator          4 ubytes    (numerater must equal the one in postamble)
  11. denominator        4 ubytes    (denominator must equal the one in postamble)
  12. magnification      4 ubytes    (magnification must equal the one in postamble)
  13. id_len             1 ubyte     (lenght of identification string)
  14. id_string     id_len ubytes    (identification string)
  15.  
  16. no_ops          >= 0 bytes     (NOP, nops before a page)
  17. begin_of_page      1 ubyte     (BOP)
  18. page_nr            4 sbytes    (page number)
  19. do_be_do          36 bytes     (filler ????)
  20. prev_page_offset   4 sbytes    (offset in file where previous page starts, -1 for none)
  21. ... PAGE DATA ...
  22. end_of_page        1 ubyte     (EOP)
  23.  
  24. no_ops ???      >= 0 bytes     (NOPS, I think they are allowed here...)
  25. postamble_marker   1 ubyte     (POST)
  26. last_page_offset   4 sbytes    (offset in file where last page starts)
  27. numerator          4 ubytes    (numerater must equal the one in preamble)
  28. denominator        4 ubytes    (denominator must equal the one in preamble)
  29. magnification      4 ubytes    (magnification must equal the one in preamble)
  30. max_page_height    4 ubytes    (maximum page height)
  31. max_page_width     4 ubytes    (maximum page width)
  32. max_stack          2 ubytes    (maximum stack depth needed)
  33. total_pages        2 ubytes    (number of pages in file)
  34. ... FONT DEFINITIONS ...
  35.  
  36. postamble_offset   4 sbytes    (offset in file where postamble starts)
  37. version_id         1 ubyte     (should be version 2)
  38. trailer         >= 4 ubytes    (TRAILER)
  39. <EOF>
  40.  
  41.  
  42. FONT DEFINITIONS:
  43.    do {
  44.       switch (c = getc(dvi_fp) {
  45.           case FNTDEF1  :
  46.           case FNTDEF2  :
  47.           case FNTDEF3  :
  48.           case FNTDEF4  :  define_font(c);
  49.           case POSTPOST : break;
  50.           default       : error;
  51.       }
  52.    } while (c != POSTPOST);
  53.  
  54. ===== A font def looks like:
  55.  
  56. 1,2,3 or 4 ubytes TeXfontnumber for FNTDEF1 .. FNTDEF4
  57. 4 ubytes checksum
  58. 4 ubytes scale
  59. 4 ubytes design size
  60. 1 byte deflen1
  61. 1 byte deflen2
  62. deflen1 + deflen2 bytes fontname.
  63.  
  64. ===== A special looks like:
  65.  
  66. 1,2,3 or 4 ubytes telling length of special command for XXX1 .. XXX4
  67. all bytes in the special command are used as defined in the dvi driver.
  68.  
  69.  
  70. */
  71.